﻿@using Microsoft.AspNetCore.Identity

@inject SignInManager<NccUser> SignInManager
@inject UserManager<NccUser> UserManager

@if (SignInManager.IsSignedIn(User))
{
    <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right">
        <ul class="nav navbar-nav navbar-right">
            <li>
                <a asp-area="" asp-controller="Home" asp-action="Index" target="_blank" title="Fontend">
                    <i class="fa fa-share fa-fw"></i>
                </a>
            </li>
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="true">
                    <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li>
                        <a asp-area="" asp-controller="Manage" asp-action="IndexBackend" title="Manage"><i class="fa fa-user fa-fw"></i> Hello @UserManager.GetUserName(User)!</a>
                    </li>
                    <li>
                        <a asp-area="" asp-controller="Manage" asp-action="ChangePasswordBackend" title="Change Password"><i class="fa fa-key fa-fw"></i> Change Password</a>
                    </li>
                    <li>
                        <button type="submit" class="btn btn-link navbar-btn navbar-link" style="color:#000;padding-left:20px;padding-top:2px;margin-top:0px;padding-bottom:2px;margin-bottom:0px;"><i class="fa fa-sign-out fa-fw"></i> Logout</button>
                    </li>                            
                    <li class="divider"></li>
                    <li>
                        <a asp-area="" asp-controller="Home" asp-action="RestartHost" title="Restart Host" style="color:red"><i class="fa fa-refresh fa-fw"></i> Restart Host</a>
                    </li>
                </ul>
                <!-- /.dropdown-user -->
            </li>
        </ul>
    </form>
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li><a asp-area="" asp-controller="CmsHome" asp-action="Index" target="_blank">Website</a></li>
        @*<li><a asp-area="" asp-controller="Admin" asp-action="Index">Admin</a></li>*@
        @*<li><a asp-area="" asp-controller="Account" asp-action="Register">Register</a></li>*@
        <li><a asp-area="" asp-controller="Account" asp-action="Login">Log in</a></li>
    </ul>
}
